﻿'------------------------------
' Hien thi 5 tin moi nhat
'------------------------------
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Namespace NVPortal.Modules.NVProduct

    Public MustInherit Class DisplayCat
        Inherits DotNetNuke.Entities.Modules.ModuleSettingsBase


#Region "Event Handlers"
        Public Overrides Sub LoadSettings()
            Try
                If (Page.IsPostBack = False) Then
                    If IsNumeric(ModuleSettings("ProductCatDisplayPageSetting")) Then
                        Me.txtDisplayProductPage.Text = ModuleSettings("ProductCatDisplayPageSetting")
                    End If
                    If IsNumeric(ModuleSettings("ProductCatDisplayPageSubSetting")) Then
                        Me.txtDisplayProductPageSub.Text = ModuleSettings("ProductCatDisplayPageSubSetting")
                    End If
                End If

            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' UpdateSettings saves the modified settings to the Database
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        '''		[cnurse]	10/22/2004	created
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Public Overrides Sub UpdateSettings()
            Try
                Dim objModules As New DotNetNuke.Entities.Modules.ModuleController

                If IsNumeric(Me.txtDisplayProductPage.Text) Then
                    objModules.UpdateModuleSetting(ModuleId, "ProductCatDisplayPageSetting", Me.txtDisplayProductPage.Text)
                End If
                If IsNumeric(Me.txtDisplayProductPageSub.Text) Then
                    objModules.UpdateModuleSetting(ModuleId, "ProductCatDisplayPageSubSetting", Me.txtDisplayProductPageSub.Text)
                End If
            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub
#End Region


    End Class

End Namespace
